Thread: calender problem in C

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    26

    Question calender problem in C

    hi all,

    does anybody know how to print the months of a year taken as input from the user in the following format:

    Jan Feb Mar
    S M T W T F S ----------------- -----------------
    1 2 3 4 5 6 7
    8 9 10 11 12 13 14
    15 16 17 18 19 20 21
    22 23 24 25 26 27 28
    29 30 31

    same way for Feb, Mar. i have to print 3 months on a row. so 12 months 4 rows. any help will be appreciated. thanx in advance.

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    does anybody know how to print the months of a year taken as input from the user in the following format:
    Yep.

    i have to print 3 months on a row. so 12 months 4 rows. any help will be appreciated. thanx in advance.
    First, print three months on a row. Next, repeat this process until the year has been printed on a total of four rows.

    Glad I could help.

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Oct 2002
    Posts
    26

    Unhappy

    um......... could you be a bit more specific as to how i can print? thanx

  4. #4
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    printf

    Quzah.
    Hope is the first step on the road to disappointment.

  5. #5
    Registered User
    Join Date
    Oct 2002
    Posts
    26
    yes....... but i'm only able to print it vertically.... like
    Jan
    ----------
    ----------

    Feb
    ----------
    ----------

    & so on. After the newline at Jan end I'm unable to go to the first line & print Feb..........

  6. #6
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Originally posted by pari
    After the newline at Jan end I'm unable to go to the first line & print Feb..........
    So stop putting a newline after Jan. You know how to do it if you think about it.

    Quzah.
    Hope is the first step on the road to disappointment.

  7. #7
    Registered User
    Join Date
    Oct 2002
    Posts
    26

    Lightbulb

    thanx a lot Salem. I figured out how to find the start day of each month & to display it properly with spaces. sometimes i just think i can't think anymore & thts when i need a lil help to push me on. like u did :-). really appreciate it a lot. will now try to figure out how to print 3 months in a row.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM